package com.exam.api.modules.system.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 部门表实体类
 *
 * @author bcheng
 */
@Schema(description="部门表")
@Data
@TableName(value = "tbl_dept")
public class TblDept implements Serializable {
    /**
     * 部门id
     */
    @TableId(value = "dept_id", type = IdType.ASSIGN_ID)
    @Schema(description="部门id")
    @NotNull(message = "部门id不能为null")
    private Long deptId;

    /**
     * 父级部门id
     */
    @TableField(value = "parent_dept_id")
    @Schema(description="父级部门id")
    private Long parentDeptId;

    /**
     * 部门名称
     */
    @TableField(value = "`name`")
    @Schema(description="部门名称")
    @Size(max = 30,message = "部门名称最大长度要小于 30")
    private String name;

    /**
     * 部门等级
     */
    @TableField(value = "`level`")
    @Schema(description="部门等级")
    private Integer level;


    /**
     * 排序
     */
    @TableField(value = "`sort`")
    @Schema(description="排序")
    private Integer sort;

    /**
     * 更新时间
     */
    @TableField(value = "update_time")
    @Schema(description="更新时间")
    private LocalDateTime updateTime;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    @Schema(description="创建时间")
    private LocalDateTime createTime;

    @Serial
    private static final long serialVersionUID = 1L;
}
